# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=gtksourceview

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}2"
pkgver=2.10.5
pkgrel=1
pkgdesc="A text widget adding syntax highlighting and more to GNOME (mingw-w64)"
arch=('any')
url="http://www.gnome.org"
license=("GPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config" "intltool")
depends=(
    "${MINGW_PACKAGE_PREFIX}-gtk2>=2.22.0"
    "${MINGW_PACKAGE_PREFIX}-libxml2>=2.7.7"
)
options=(!libtool strip staticlibs)
source=("http://ftp.gnome.org/pub/gnome/sources/gtksourceview/${pkgver%.*}/gtksourceview-${pkgver}.tar.bz2")
md5sums=('1219ad1694df136f126507466aeb41aa')

prepare() {
  cd ${_realname}-$pkgver
  sed -i 's#python#python2#' gtksourceview/language-specs/convert.py
}

build() {
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --enable-shared \
    --disable-static \
    --enable-compile-warnings=maximum
  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make -j1 DESTDIR="$pkgdir" install
}
